com.supermap.realspace

Class Scene

  • java.lang.Object
    • com.supermap.realspace.Scene


  • public class Scene
    extends java.lang.Object
    3D scene class.

    The main body of the SuperMap iObjects Java 3D scene is a 3D sphere that simulates the earth (SuperMap Objects Java uses a sphere with a radius of 6378137 meters to simulate the earth). The sphere has a geographic reference. The points on the sphere are located by latitude and longitude, and You can easily browse through the latitude and longitude grid on the sphere provided by the 3D scene; at the same time, use the global remote sensing image map as a background to cover the surface of the sphere, enhancing the fidelity of the 3D sphere simulation; in addition, the 3D scene also simulates The environment the earth is in includes: the starry sky of the universe, the atmosphere of the earth, the foggy environment on the surface of the earth, etc. The 3D scene also provides camera settings. The camera can be used to control the observation angle, orientation and scope of the sphere, so as to present different parts of the sphere from different perspectives.

    Various 3D data will be added to the basic organization structure of the 3D scene through the 3D scene, that is, the 3D data will be added to the sphere provided by SuperMap Objects Java based on the geographic reference information.

    • Constructor Summary

      Constructors 
      Constructor and Description
      Scene() 
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void close()
      Close the current scene
      void dispose()
      Release the resources occupied by the object.
      int[] drillPickforDynamicObject(java.lang.String objectName, Point point, int count)
      Pick-up feature.
      void ensureVisible(Layer3D layer3d)
      The scene is displayed based on the latitude and longitude range of the center block of the layer
      void ensureVisible(Rectangle2D visibleBounds)
      The scene is displayed according to the latitude and longitude range.
      void fly(LookAt lookAt)
      Fly according to the specified target camera object.
      void fly(LookAt lookAt, int milliseconds, boolean isdrct)
      Fly according to the specified target camera object and flight time.
      void flyCircle(Geometry geometry, double speedRatio)
      Rotate and fly around a designated location, and you can control the speed of the flight during the flight.
      void flyToCamera(Camera camera, int milliseconds, boolean isDirect)
      Fly according to the specified target object and altitude mode.
      void flyToCamera(Camera camera, int altitudeMode, int milliseconds)
      Fly according to the specified target object, altitude mode and flight time.
      void flyToPoint(Point3D point)
      Fly to the specified 3D point position.
      void flyToPoint(Point3D point, int milliseconds)
      Fly according to the target point location and flight time.
      void flytoVector(Point3D viewerPoint3D, Point3D targetPoint3D, int milliseconds)
      Fixed-point observation, support input of the starting observation point and target point, the camera flies to the observation point.
      boolean getAtmosphereVisible()
      Get visibility of atmospheric conditions.
      Camera getCamera()
      Return the camera object of the current scene.
      boolean getCreateSkirt()
      Get whether to create a terrain skirt.
      Camera getFirstPersonCamera()
      Return the first-person camera parameters of the current scene.
      FlyManager getFlyManager()
      Return the FlyManager object associated with the 3D scene.
      double getFPS()
      Get the frame rate of the current scene, that is, frames per second.
      GlobalImage getGlobalImage()
      Return the global basemap object.
      Layer3Ds getLayers()
      Returns the 3D layer collection object.
      LookAt getLookAt()
      Get the camera object of the current scene.
      MultiViewportMode getMultiViewportMode()
      Get the multi-viewport mode of the current scene.
      java.lang.String getName()
      Get the current 3D scene name.
      SceneType getSceneType()
      Get the scene type.
      TerrainLayers getTerrainLayers()
      Return the terrain layer collection in the 3D scene.
      TrackingLayer3D getTrackingLayer()
      Returns the screen layer collection in the 3D scene.
      java.lang.String getUrl()
      Return the 3D service url path associated with the 3D scene.
      Workspace getWorkspace()
      Return the workspace associated with the 3D scene.
      Point globeToPixel(Point3D point)
      Convert 3D point objects into screen point objects.
      boolean isZoomFlyPitching()
      Get whether the tilt operation is performed when the scene is zoomed to the ground.
      boolean open(java.lang.String sceneName)
      Open the 3D scene with the specified name in the workspace.
      boolean open(java.lang.String iserverUrl, java.lang.String sceneName)
      Open the 3D scene with the specified name in the 3D service published by iServer.
      boolean open(java.lang.String iserverUrl, java.lang.String sceneName, java.lang.String passWord)
      Open the offline 3D scene that has been downloaded from the 3D service published by iServer.
      boolean openPrivateSceneWithUrl(java.lang.String onlineprivateURL, java.lang.String sceneName)
      After logging in to SuperMap Online, open the 3D scene through the online data private service.
      boolean openTokenService(java.lang.String iserverUrl, java.lang.String strSceneName, java.lang.String token)
      Open the data service with token encryption authentication.
      android.graphics.Bitmap outputSceneToBitmap()
      Export the 3D scene as a bitmap object.
      void pan(double offsetLongitude, double offsetLatitude)
      Pan three-dimensional scene.
      Point3D pixelToGlobe(Point point)
      Convert the screen point object into a three-dimensional point object, which contains latitude, longitude and altitude information.
      Point3D pixelToGlobe(Point point, PixelToGlobeMode mode)
      Convert screen point objects into 3D point objects.
      void refresh()
      Refresh the 3D map scene.
      void sceneReset()
      Scene reset.
      void setAtmosphereVisible(boolean atmosphereVisible)
      Set the visibility of the atmospheric state, and the realism of the 3D scene can be enhanced by setting the atmospheric simulation.
      void setAutoLockOffset(Point3D value)
      Sets the offset of the camera relative to the locked object, which can be used when locking the target object Changes the offset of the x, y, and z axes of the camera object in meters
      void setCamera(Camera camera)
      Set the camera object of the current scene.
      void setCreateSkirt(boolean createSkirt)
      Set whether to create a terrain skirt.
      void setFirstPersonCamera(Camera camera)
      Set the first-person view camera parameters of the current scene.
      void setLookAt(LookAt lookAt)
      Set the camera object of the current scene.
      void setMultiViewportMode(MultiViewportMode multiViewportMode)
      Set the multi-viewport mode type of the current scene.
      void SetOverlapDisplayed(boolean value)
      Whether to display when setting the cover.
      void setPitch(double ratio)
      Observe the three-dimensional scene obliquely at a certain angle.
      void setRollEye(double ratio)
      The 3D scene rotates a certain angle around the viewpoint.
      void setWorkspace(Workspace workspace)
      Set the working space associated with the 3D scene.
      void setZoomFlyPitching(boolean zoomFlyPitching)
      Set whether to turn on the tilt operation when the scene is zoomed to the ground.
      void stopCameraInteria()
      Stop camera inertia.
      void viewEntire()
      The scene is displayed in full frame.
      void zoom(double ratio)
      Perform zoom operations on the 3D map scene according to the given zoom ratio.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Scene

        public Scene()
    • Method Detail

      • getCamera

        public Camera getCamera()
        Return the camera object of the current scene. Camera is equivalent to viewpoint.
        Returns:
        The camera object of the current scene.
      • setCamera

        public void setCamera(Camera camera)
        Set the camera object of the current scene. Camera is equivalent to viewpoint.
        Parameters:
        camera - The camera object of the current scene.
      • getTerrainLayers

        public TerrainLayers getTerrainLayers()
        Return the terrain layer collection in the 3D scene.
        Returns:
        The terrain layer collection in the 3D scene.
      • getTrackingLayer

        public TrackingLayer3D getTrackingLayer()
        Returns the screen layer collection in the 3D scene.
        Returns:
        The screen layer collection in the 3D scene.
      • getWorkspace

        public Workspace getWorkspace()
        Return the workspace associated with the 3D scene.
        Returns:
        The workspace associated with the 3D scene.
      • setWorkspace

        public void setWorkspace(Workspace workspace)
        Set the working space associated with the 3D scene.
        Parameters:
        workspace - The workspace associated with the 3D scene.
      • getLayers

        public Layer3Ds getLayers()
        Returns the 3D layer collection object.
        Returns:
        3D layer collection object.
      • flyToPoint

        public void flyToPoint(Point3D point)
        Fly to the specified 3D point position.
        Parameters:
        point - The position of the target point.
      • flyToPoint

        public void flyToPoint(Point3D point,
                               int milliseconds)
        Fly according to the target point location and flight time.
        Parameters:
        point - The position of the target point.
        milliseconds - specifies the time it takes to fly to the specified target point. The unit is milliseconds.
      • flyToCamera

        public void flyToCamera(Camera camera,
                                int milliseconds,
                                boolean isDirect)
        Fly according to the specified target object and altitude mode.

        When the destination is not in the current field of view, if isDirect is true, it will fly directly, and if it is false, it will be pulled up and then fly over.

        The target camera object specified by @param camera.
        Parameters:
        milliseconds - specifies the flight time.
        isDirect - determines whether to fly directly or pull up and then fly.
      • flyToCamera

        public void flyToCamera(Camera camera,
                                int altitudeMode,
                                int milliseconds)
        Fly according to the specified target object, altitude mode and flight time. The target camera object specified by @param camera.
        Parameters:
        altitudeMode - The specified altitude mode.
        milliseconds - specifies the time it takes for the camera to fly to the specified destination. The unit is milliseconds.
      • dispose

        public void dispose()
        Release the resources occupied by the object. After calling this method, this object is no longer available.
      • ensureVisible

        public void ensureVisible(Layer3D layer3d)
        The scene is displayed based on the latitude and longitude range of the center block of the layer
        Parameters:
        layer3d - Three-dimensional layer object.
      • getFlyManager

        public FlyManager getFlyManager()
        Return the FlyManager object associated with the 3D scene.
        Returns:
        The FlyManager object associated with the 3D scene.
      • ensureVisible

        public void ensureVisible(Rectangle2D visibleBounds)
        The scene is displayed according to the latitude and longitude range.
        Parameters:
        visibleBounds - specifies the visible range of the current scene.
      • getUrl

        public java.lang.String getUrl()
        Return the 3D service url path associated with the 3D scene.
        Returns:
        The 3D service url path associated with the 3D scene.
      • close

        public void close()
        Close the current scene
      • open

        public boolean open(java.lang.String sceneName)
        Open the 3D scene with the specified name in the workspace. The specified name is the name of a scene in the scene collection object in the workspace associated with the scene.
        Parameters:
        sceneName - The name of the scene.
        Returns:
        returns true if the open is successful, otherwise false.

        Note: Opening the 3D scene with the specified name in the workspace requires configuration permission.

      • open

        public boolean open(java.lang.String iserverUrl,
                            java.lang.String sceneName)
        Open the 3D scene with the specified name in the 3D service published by iServer. The scene name is the name that contains a scene in the service.
        Parameters:
        iserverUrl - URL address of the 3D service (such as: http://118.186.246.138:8091/iserver/services/realspace-Scene/rest/realspace).
        sceneName - The name of the scene.
        Returns:
        returns true if the open is successful, otherwise false.
      • open

        public boolean open(java.lang.String iserverUrl,
                            java.lang.String sceneName,
                            java.lang.String passWord)
        Open the offline 3D scene that has been downloaded from the 3D service published by iServer.
        Parameters:
        iserverUrl - URL address of the 3D service (such as: http://118.186.246.138:8091/iserver/services/realspace-Scene/rest/realspace).
        sceneName - The name of the scene.
        passWord - Scene password, the default password is "supermap".
        Returns:
        returns true if the open is successful, otherwise false.

        Note: The storage location of offline files is in the device default storage directory/SuperMap/LocalData/ folder.

      • openTokenService

        public boolean openTokenService(java.lang.String iserverUrl,
                                        java.lang.String strSceneName,
                                        java.lang.String token)
        Open the data service with token encryption authentication.
        Parameters:
        iserverUrl - URL address of the 3D service (such as: http://118.186.246.138:8091/iserver/services/realspace-Scene/rest/realspace).
        strSceneName - The name of the scene.
        token - token token.
        Returns:
        returns true if the open is successful, otherwise false.
      • viewEntire

        public void viewEntire()
        The scene is displayed in full frame.
      • pixelToGlobe

        public Point3D pixelToGlobe(Point point)
        Convert the screen point object into a three-dimensional point object, which contains latitude, longitude and altitude information. If the screen point is not within the range of the earth, the returned 3D point latitude, longitude and height are Double.NaN, which is not a numeric value. The screen point object specified by @param point.
        Returns:
        The converted 3D point object.
      • pixelToGlobe

        public Point3D pixelToGlobe(Point point,
                                    PixelToGlobeMode mode)
        Convert screen point objects into 3D point objects. This method can be used to determine whether the selected point is on the model or on the terrain. The screen point object specified by @param point.
        Parameters:
        mode - The intersection type for converting screen point objects to 3D point objects.
        Returns:
        The converted 3D point object.
      • globeToPixel

        public Point globeToPixel(Point3D point)
        Convert 3D point objects into screen point objects.

        When the specified 3D point object is not within the current camera range, the method will return (-1, -1), indicating that the point is not visible.

        The 3D point object specified by @param point, which contains the information of latitude, longitude and altitude.
        Returns:
        The converted two-dimensional point object.
      • outputSceneToBitmap

        public android.graphics.Bitmap outputSceneToBitmap()
        Export the 3D scene as a bitmap object.
        Returns:
        Bitmap object.
      • refresh

        public void refresh()
        Refresh the 3D map scene.
      • getName

        public java.lang.String getName()
        Get the current 3D scene name.
        Returns:
        The current 3D scene name.
      • zoom

        public void zoom(double ratio)
        Perform zoom operations on the 3D map scene according to the given zoom ratio.

        The range of the zoom ratio is from negative infinity to 1. When the parameter is a value between (0,1), the scene is scaled up; when the parameter value is less than 0, the scene is scaled down, but it will not be scaled down after it is reduced to a certain extent.

        Parameters:
        ratio - specifies the zoom ratio value.
      • stopCameraInteria

        public void stopCameraInteria()
        Stop camera inertia.
      • flyCircle

        public void flyCircle(Geometry geometry,
                              double speedRatio)
        Rotate and fly around a designated location, and you can control the speed of the flight during the flight. The target geometric object specified by @param geometry.
        Parameters:
        speedRatio - is the multiple of the reference flight speed, the default is 1.
      • getFirstPersonCamera

        public Camera getFirstPersonCamera()
        Return the first-person camera parameters of the current scene.
        Returns:
        First-person camera parameters.
      • setFirstPersonCamera

        public void setFirstPersonCamera(Camera camera)
        Set the first-person view camera parameters of the current scene.
        Parameters:
        camera - specifies the first-person camera parameters.
      • pan

        public void pan(double offsetLongitude,
                        double offsetLatitude)
        Pan three-dimensional scene.
        Parameters:
        offsetLongitude - specifies the meridional translation distance.
        offsetLatitude - specifies the latitude translation distance.
      • sceneReset

        public void sceneReset()
        Scene reset. After opening the online scene, you can call this method to reset the scene to avoid scene collapse.
      • isZoomFlyPitching

        public boolean isZoomFlyPitching()
        Get whether the tilt operation is performed when the scene is zoomed to the ground.
        Returns:
        returns true when pitch is turned on, otherwise it returns false.
      • setZoomFlyPitching

        public void setZoomFlyPitching(boolean zoomFlyPitching)
        Set whether to turn on the tilt operation when the scene is zoomed to the ground.
        Parameters:
        zoomFlyPitching - specifies whether to turn on the pitch.
      • setMultiViewportMode

        public void setMultiViewportMode(MultiViewportMode multiViewportMode)
        Set the multi-viewport mode type of the current scene.
        Parameters:
        multiViewportMode - Specifies the type of multi-viewport mode.
      • getMultiViewportMode

        public MultiViewportMode getMultiViewportMode()
        Get the multi-viewport mode of the current scene.
        Returns:
        Multi-viewport mode of the scene.
      • getGlobalImage

        public GlobalImage getGlobalImage()
        Return the global basemap object.
        Returns:
        Global basemap object.
      • getAtmosphereVisible

        public boolean getAtmosphereVisible()
        Get visibility of atmospheric conditions.
        Returns:
        Visibility of atmospheric state.
      • setAtmosphereVisible

        public void setAtmosphereVisible(boolean atmosphereVisible)
        Set the visibility of the atmospheric state, and the realism of the 3D scene can be enhanced by setting the atmospheric simulation.
        Parameters:
        atmosphereVisible - specifies the visibility of the atmosphere state.
      • setCreateSkirt

        public void setCreateSkirt(boolean createSkirt)
        Set whether to create a terrain skirt. When there are cracks in the TIN terrain, creating skirts can avoid the display of cracks and improve the TIN terrain effect.
        Parameters:
        createSkirt - specifies whether to create a terrain skirt.
      • getCreateSkirt

        public boolean getCreateSkirt()
        Get whether to create a terrain skirt. When there are cracks in the TIN terrain, creating skirts can avoid the display of cracks and improve the TIN terrain effect.
        Returns:
        Whether to create a terrain skirt, specify creation to return true, otherwise return false.
      • openPrivateSceneWithUrl

        public boolean openPrivateSceneWithUrl(java.lang.String onlineprivateURL,
                                               java.lang.String sceneName)
        After logging in to SuperMap Online, open the 3D scene through the online data private service.
        Parameters:
        onlineprivateURL - specifies the private service URL that can be obtained after login.
        sceneName - specifies the name of the private service scene that can be obtained after login.
        Returns:
        returns true if it opens successfully, otherwise it returns false.
      • setPitch

        public void setPitch(double ratio)
        Observe the three-dimensional scene obliquely at a certain angle.
        Parameters:
        ratio - specifies the tilt angle.
      • setRollEye

        public void setRollEye(double ratio)
        The 3D scene rotates a certain angle around the viewpoint.
        Parameters:
        ratio - specifies the angle of rotation.
      • fly

        public void fly(LookAt lookAt)
        Fly according to the specified target camera object.
        Parameters:
        lookAt - specifies the target LookAt camera.
      • fly

        public void fly(LookAt lookAt,
                        int milliseconds,
                        boolean isdrct)
        Fly according to the specified target camera object and flight time.
        Parameters:
        lookAt - specified target LookAt camera
        milliseconds - specifies the flight time.
        isdrct - decides whether to fly directly or pull up and then fly.
      • setLookAt

        public void setLookAt(LookAt lookAt)
        Set the camera object of the current scene. The LookAt camera specified by @param lookAt.
      • getLookAt

        public LookAt getLookAt()
        Get the camera object of the current scene. The LookAt camera specified by @return lookAt.
      • SetOverlapDisplayed

        public void SetOverlapDisplayed(boolean value)
        Whether to display when setting the cover.
        Parameters:
        value - determines whether to display when pressing, a boolean value.
      • getFPS

        public double getFPS()
        Get the frame rate of the current scene, that is, frames per second. This value is usually used to judge the display efficiency of the 3D scene.
        Returns:
        The frame rate of the current scene.
      • flytoVector

        public void flytoVector(Point3D viewerPoint3D,
                                Point3D targetPoint3D,
                                int milliseconds)
        Fixed-point observation, support input of the starting observation point and target point, the camera flies to the observation point.
      • getSceneType

        public SceneType getSceneType()
        Get the scene type.
        Returns:
        SceneType Scene type.
      • drillPickforDynamicObject

        public int[] drillPickforDynamicObject(java.lang.String objectName,
                                               Point point,
                                               int count)
        Pick-up feature. It supports entering screen coordinates and picking id level number and returns id array of all objects in the screen points
      • setAutoLockOffset

        public void setAutoLockOffset(Point3D value)
        Sets the offset of the camera relative to the locked object, which can be used when locking the target object Changes the offset of the x, y, and z axes of the camera object in meters